package com.tian.mapper;

import com.tian.dto.ChargeRecordPageReqDto;
import com.tian.dto.ChargingRecordPageReqDto;
import com.tian.entity.ChargeRecord;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Mapper

public interface ChargeRecordMapper {
    int deleteByPrimaryKey(Long id);

    int insert(ChargeRecord record);

    ChargeRecord selectByPrimaryKey(Long id);

    ChargeRecord selectByByUserId(Long userId);

    List<ChargeRecord> selectAll();

    int updateByPrimaryKey(ChargeRecord record);

    ChargeRecord selectByChargeGunId(Integer chargerGunId);

    int checkRecordExists(Integer chargerGunId);

    int chargeTimesCount(Date queryDate);

    List<ChargeRecord> listByByUserId(ChargeRecordPageReqDto chargeRecordPageReqDto);

    List<ChargeRecord> selectByCondition(ChargingRecordPageReqDto chargingRecordPageReqDto);

    long countTimes();
    BigDecimal sumAmount();
}